package com.example.testapplication;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;
import android.widget.Toast;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


public class ButterknifeActivity extends Activity {
    @BindView(R.id.bt_butterknife)
    Button btn;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_butterknife)
    TextView tvButterknife;
    @BindView(R.id.cb_butterknife)
    CheckBox cbButterknife;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_butterknife);

        ButterKnife.bind(this);


        initData();

    }

    @OnClick(R.id.bt_butterknife)
    void btnClick(View view) {
        Toast.makeText(ButterknifeActivity.this, "点击了", Toast.LENGTH_SHORT).show();
    }
    @OnClick(R.id.cb_butterknife)
    void btnCherch(View view){
        Toast.makeText(ButterknifeActivity.this, "点击了checkbox", Toast.LENGTH_SHORT).show();
    }


    private void initData() {
        tvTitle.setText("插件难搞");
        tvButterknife.setText("butterknife版本问题");

    }


}